<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-pragma">{-# LINE 1 &quot;libraries\\base\\System\\Environment\\ExecutablePath.hsc&quot; #-}</span><span>
</span><span id="line-1"></span><span class="hs-pragma">{-# LANGUAGE Safe #-}</span><span>
</span><span id="line-2"></span><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-3"></span><span>
</span><span id="line-4"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-5"></span><span class="hs-comment">-- |</span><span>
</span><span id="line-6"></span><span class="hs-comment">-- Module      :  System.Environment.ExecutablePath</span><span>
</span><span id="line-7"></span><span class="hs-comment">-- Copyright   :  (c) The University of Glasgow 2001</span><span>
</span><span id="line-8"></span><span class="hs-comment">-- License     :  BSD-style (see the file libraries/base/LICENSE)</span><span>
</span><span id="line-9"></span><span class="hs-comment">--</span><span>
</span><span id="line-10"></span><span class="hs-comment">-- Maintainer  :  libraries@haskell.org</span><span>
</span><span id="line-11"></span><span class="hs-comment">-- Stability   :  provisional</span><span>
</span><span id="line-12"></span><span class="hs-comment">-- Portability :  portable</span><span>
</span><span id="line-13"></span><span class="hs-comment">--</span><span>
</span><span id="line-14"></span><span class="hs-comment">-- Function to retrieve the absolute filepath of the current executable.</span><span>
</span><span id="line-15"></span><span class="hs-comment">--</span><span>
</span><span id="line-16"></span><span class="hs-comment">-- @since 4.6.0.0</span><span>
</span><span id="line-17"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-18"></span><span>
</span><span id="line-19"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">System.Environment.ExecutablePath</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="System.Environment.ExecutablePath.html#getExecutablePath"><span class="hs-identifier">getExecutablePath</span></a></span><span> </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-20"></span><span>
</span><span id="line-21"></span><span class="hs-comment">-- The imports are purposely kept completely disjoint to prevent edits</span><span>
</span><span id="line-22"></span><span class="hs-comment">-- to one OS implementation from breaking another.</span><span>
</span><span id="line-23"></span><span>
</span><span id="line-24"></span><span>
</span><span id="line-25"></span><span class="hs-pragma">{-# LINE 45 &quot;libraries\\base\\System\\Environment\\ExecutablePath.hsc&quot; #-}</span><span>
</span><span id="line-45"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Control.Exception.html"><span class="hs-identifier">Control.Exception</span></a></span><span>
</span><span id="line-46"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.List.html"><span class="hs-identifier">Data.List</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="Data.OldList.html#isPrefixOf"><span class="hs-identifier">isPrefixOf</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-47"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Data.Word.html"><span class="hs-identifier">Data.Word</span></a></span><span>
</span><span id="line-48"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Foreign.C.html"><span class="hs-identifier">Foreign.C</span></a></span><span>
</span><span id="line-49"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Foreign.Marshal.Array.html"><span class="hs-identifier">Foreign.Marshal.Array</span></a></span><span>
</span><span id="line-50"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="Foreign.Ptr.html"><span class="hs-identifier">Foreign.Ptr</span></a></span><span>
</span><span id="line-51"></span><span>
</span><span id="line-52"></span><span>
</span><span id="line-53"></span><span>
</span><span id="line-54"></span><span class="hs-pragma">{-# LINE 60 &quot;libraries\\base\\System\\Environment\\ExecutablePath.hsc&quot; #-}</span><span>
</span><span id="line-60"></span><span>
</span><span id="line-61"></span><span class="hs-comment">-- The exported function is defined outside any if-guard to make sure</span><span>
</span><span id="line-62"></span><span class="hs-comment">-- every OS implements it with the same type.</span><span>
</span><span id="line-63"></span><span>
</span><span id="line-64"></span><span class="hs-comment">-- | Returns the absolute pathname of the current executable.</span><span>
</span><span id="line-65"></span><span class="hs-comment">--</span><span>
</span><span id="line-66"></span><span class="hs-comment">-- Note that for scripts and interactive sessions, this is the path to</span><span>
</span><span id="line-67"></span><span class="hs-comment">-- the interpreter (e.g. ghci.)</span><span>
</span><span id="line-68"></span><span class="hs-comment">--</span><span>
</span><span id="line-69"></span><span class="hs-comment">-- Since base 4.11.0.0, 'getExecutablePath' resolves symlinks on Windows.</span><span>
</span><span id="line-70"></span><span class="hs-comment">-- If an executable is launched through a symlink, 'getExecutablePath'</span><span>
</span><span id="line-71"></span><span class="hs-comment">-- returns the absolute path of the original executable.</span><span>
</span><span id="line-72"></span><span class="hs-comment">--</span><span>
</span><span id="line-73"></span><span class="hs-comment">-- @since 4.6.0.0</span><span>
</span><span id="line-74"></span><span class="annot"><a href="System.Environment.ExecutablePath.html#getExecutablePath"><span class="hs-identifier hs-type">getExecutablePath</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-75"></span><span>
</span><span id="line-76"></span><span class="hs-comment">--------------------------------------------------------------------------------</span><span>
</span><span id="line-77"></span><span class="hs-comment">-- Mac OS X</span><span>
</span><span id="line-78"></span><span>
</span><span id="line-79"></span><span>
</span><span id="line-80"></span><span class="hs-pragma">{-# LINE 186 &quot;libraries\\base\\System\\Environment\\ExecutablePath.hsc&quot; #-}</span><span>
</span><span id="line-186"></span><span>
</span><span id="line-187"></span><span>
</span><span id="line-188"></span><span class="hs-pragma">{-# LINE 190 &quot;libraries\\base\\System\\Environment\\ExecutablePath.hsc&quot; #-}</span><span class="hs-cpp">
#  define WINDOWS_CCONV ccall
</span><span>
</span><span id="line-192"></span><span class="hs-pragma">{-# LINE 194 &quot;libraries\\base\\System\\Environment\\ExecutablePath.hsc&quot; #-}</span><span>
</span><span id="line-194"></span><span>
</span><span id="line-195"></span><span id="getExecutablePath"><span class="annot"><span class="annottext">getExecutablePath :: IO FilePath
</span><a href="System.Environment.ExecutablePath.html#getExecutablePath"><span class="hs-identifier hs-var hs-var">getExecutablePath</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word32 -&gt; IO FilePath
</span><a href="#local-6989586621679564027"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Word32
</span><span class="hs-number">2048</span></span><span>  </span><span class="hs-comment">-- plenty, PATH_MAX is 512 under Win32</span><span>
</span><span id="line-196"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-197"></span><span>    </span><span id="local-6989586621679564027"><span class="annot"><span class="annottext">go :: Word32 -&gt; IO FilePath
</span><a href="#local-6989586621679564027"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621679564005"><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621679564005"><span class="hs-identifier hs-var">size</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; (Ptr CWchar -&gt; IO FilePath) -&gt; IO FilePath
forall a b. Storable a =&gt; Int -&gt; (Ptr a -&gt; IO b) -&gt; IO b
</span><a href="Foreign.Marshal.Array.html#allocaArray"><span class="hs-identifier hs-var">allocaArray</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word32 -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621679564005"><span class="hs-identifier hs-var">size</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">((Ptr CWchar -&gt; IO FilePath) -&gt; IO FilePath)
-&gt; (Ptr CWchar -&gt; IO FilePath) -&gt; IO FilePath
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span> </span><span id="local-6989586621679564003"><span class="annot"><span class="annottext">Ptr CWchar
</span><a href="#local-6989586621679564003"><span class="hs-identifier hs-var">buf</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-198"></span><span>        </span><span id="local-6989586621679564002"><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621679564002"><span class="hs-identifier hs-var">ret</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Ptr () -&gt; Ptr CWchar -&gt; Word32 -&gt; IO Word32
</span><a href="System.Environment.ExecutablePath.html#c_GetModuleFileName"><span class="hs-identifier hs-var">c_GetModuleFileName</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr ()
forall a. Ptr a
</span><a href="GHC.Ptr.html#nullPtr"><span class="hs-identifier hs-var">nullPtr</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr CWchar
</span><a href="#local-6989586621679564003"><span class="hs-identifier hs-var">buf</span></a></span><span> </span><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621679564005"><span class="hs-identifier hs-var">size</span></a></span><span>
</span><span id="line-199"></span><span>        </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621679564002"><span class="hs-identifier hs-var">ret</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-200"></span><span>            </span><span class="annot"><span class="annottext">Word32
</span><span class="hs-number">0</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; IO FilePath
forall a. FilePath -&gt; a
</span><a href="GHC.Err.html#errorWithoutStackTrace"><span class="hs-identifier hs-var">errorWithoutStackTrace</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;getExecutablePath: GetModuleFileNameW returned an error&quot;</span></span><span>
</span><span id="line-201"></span><span>            </span><span class="annot"><span class="annottext">Word32
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621679564002"><span class="hs-identifier hs-var">ret</span></a></span><span> </span><span class="annot"><span class="annottext">Word32 -&gt; Word32 -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3C"><span class="hs-operator hs-var">&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621679564005"><span class="hs-identifier hs-var">size</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-202"></span><span>                  </span><span id="local-6989586621679563997"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679563997"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Ptr CWchar -&gt; IO FilePath
</span><a href="Foreign.C.String.html#peekCWString"><span class="hs-identifier hs-var">peekCWString</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr CWchar
</span><a href="#local-6989586621679564003"><span class="hs-identifier hs-var">buf</span></a></span><span>
</span><span id="line-203"></span><span>                  </span><span id="local-6989586621679563995"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679563995"><span class="hs-identifier hs-var">real</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; IO FilePath
</span><a href="System.Environment.ExecutablePath.html#getFinalPath"><span class="hs-identifier hs-var">getFinalPath</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679563997"><span class="hs-identifier hs-var">path</span></a></span><span>
</span><span id="line-204"></span><span>                  </span><span id="local-6989586621679563993"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679563993"><span class="hs-identifier hs-var">exists</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; (Ptr CWchar -&gt; IO Bool) -&gt; IO Bool
forall a. FilePath -&gt; (Ptr CWchar -&gt; IO a) -&gt; IO a
</span><a href="Foreign.C.String.html#withCWString"><span class="hs-identifier hs-var">withCWString</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679563995"><span class="hs-identifier hs-var">real</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr CWchar -&gt; IO Bool
</span><a href="System.Environment.ExecutablePath.html#c_pathFileExists"><span class="hs-identifier hs-var">c_pathFileExists</span></a></span><span>
</span><span id="line-205"></span><span>                  </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621679563993"><span class="hs-identifier hs-var">exists</span></a></span><span>
</span><span id="line-206"></span><span>                    </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; IO FilePath
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679563995"><span class="hs-identifier hs-var">real</span></a></span><span>
</span><span id="line-207"></span><span>                    </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; IO FilePath
forall (m :: * -&gt; *) a. MonadFail m =&gt; FilePath -&gt; m a
</span><a href="Control.Monad.Fail.html#fail"><span class="hs-identifier hs-var">fail</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679563997"><span class="hs-identifier hs-var">path</span></a></span><span>
</span><span id="line-208"></span><span>              </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Word32 -&gt; IO FilePath
</span><a href="#local-6989586621679564027"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621679564005"><span class="hs-identifier hs-var">size</span></a></span><span> </span><span class="annot"><span class="annottext">Word32 -&gt; Word32 -&gt; Word32
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="annot"><span class="annottext">Word32
</span><span class="hs-number">2</span></span><span class="hs-special">)</span><span>
</span><span id="line-209"></span><span>
</span><span id="line-210"></span><span class="hs-comment">-- | Returns the final path of the given path. If the given</span><span>
</span><span id="line-211"></span><span class="hs-comment">--   path is a symbolic link, the returned value is the</span><span>
</span><span id="line-212"></span><span class="hs-comment">--   path the (possibly chain of) symbolic link(s) points to.</span><span>
</span><span id="line-213"></span><span class="hs-comment">--   Otherwise, the original path is returned, even when the filepath</span><span>
</span><span id="line-214"></span><span class="hs-comment">--   is incorrect.</span><span>
</span><span id="line-215"></span><span class="hs-comment">--</span><span>
</span><span id="line-216"></span><span class="hs-comment">-- Adapted from:</span><span>
</span><span id="line-217"></span><span class="hs-comment">-- https://msdn.microsoft.com/en-us/library/windows/desktop/aa364962.aspx</span><span>
</span><span id="line-218"></span><span class="annot"><a href="System.Environment.ExecutablePath.html#getFinalPath"><span class="hs-identifier hs-type">getFinalPath</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="GHC.IO.html#FilePath"><span class="hs-identifier hs-type">FilePath</span></a></span><span>
</span><span id="line-219"></span><span id="getFinalPath"><span class="annot"><span class="annottext">getFinalPath :: FilePath -&gt; IO FilePath
</span><a href="System.Environment.ExecutablePath.html#getFinalPath"><span class="hs-identifier hs-var hs-var">getFinalPath</span></a></span></span><span> </span><span id="local-6989586621679563989"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679563989"><span class="hs-identifier hs-var">path</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; (Ptr CWchar -&gt; IO FilePath) -&gt; IO FilePath
forall a. FilePath -&gt; (Ptr CWchar -&gt; IO a) -&gt; IO a
</span><a href="Foreign.C.String.html#withCWString"><span class="hs-identifier hs-var">withCWString</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679563989"><span class="hs-identifier hs-var">path</span></a></span><span> </span><span class="annot"><span class="annottext">((Ptr CWchar -&gt; IO FilePath) -&gt; IO FilePath)
-&gt; (Ptr CWchar -&gt; IO FilePath) -&gt; IO FilePath
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679563988"><span class="annot"><span class="annottext">Ptr CWchar
</span><a href="#local-6989586621679563988"><span class="hs-identifier hs-var">s</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-220"></span><span>  </span><span class="annot"><span class="annottext">IO (Ptr ())
-&gt; (Ptr () -&gt; IO Bool) -&gt; (Ptr () -&gt; IO FilePath) -&gt; IO FilePath
forall a b c. IO a -&gt; (a -&gt; IO b) -&gt; (a -&gt; IO c) -&gt; IO c
</span><a href="Control.Exception.Base.html#bracket"><span class="hs-identifier hs-var">bracket</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Ptr CWchar -&gt; IO (Ptr ())
</span><a href="System.Environment.ExecutablePath.html#createFile"><span class="hs-identifier hs-var">createFile</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr CWchar
</span><a href="#local-6989586621679563988"><span class="hs-identifier hs-var">s</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Ptr () -&gt; IO Bool
</span><a href="System.Environment.ExecutablePath.html#c_closeHandle"><span class="hs-identifier hs-var">c_closeHandle</span></a></span><span> </span><span class="annot"><span class="annottext">((Ptr () -&gt; IO FilePath) -&gt; IO FilePath)
-&gt; (Ptr () -&gt; IO FilePath) -&gt; IO FilePath
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679563984"><span class="annot"><span class="annottext">Ptr ()
</span><a href="#local-6989586621679563984"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-221"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621679563978"><span class="annot"><span class="annottext">invalid :: Bool
</span><a href="#local-6989586621679563978"><span class="hs-identifier hs-var hs-var">invalid</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Ptr ()
</span><a href="#local-6989586621679563984"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr () -&gt; Ptr () -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3D%3D"><span class="hs-operator hs-var">==</span></a></span><span> </span><span class="annot"><span class="annottext">WordPtr -&gt; Ptr ()
forall a. WordPtr -&gt; Ptr a
</span><a href="Foreign.Ptr.html#wordPtrToPtr"><span class="hs-identifier hs-var">wordPtrToPtr</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">-</span><span class="annot"><span class="annottext">WordPtr
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-222"></span><span class="hs-pragma">{-# LINE 222 &quot;libraries\\base\\System\\Environment\\ExecutablePath.hsc&quot; #-}</span><span>
</span><span id="line-222"></span><span>    </span><span class="hs-keyword">if</span><span> </span><span class="hs-identifier">invalid</span><span> </span><span class="hs-keyword">then</span><span> </span><span class="hs-identifier">pure</span><span> </span><span class="hs-identifier">path</span><span> </span><span class="hs-keyword">else</span><span> </span><span class="hs-identifier">go</span><span> </span><span class="hs-identifier">h</span><span> </span><span class="hs-identifier">bufSize</span><span>
</span><span id="line-223"></span><span>
</span><span id="line-224"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621679563976"><span class="annot"><span class="annottext">go :: Ptr () -&gt; Word32 -&gt; IO FilePath
</span><a href="#local-6989586621679563976"><span class="hs-identifier hs-var hs-var">go</span></a></span></span><span> </span><span id="local-6989586621679563964"><span class="annot"><span class="annottext">Ptr ()
</span><a href="#local-6989586621679563964"><span class="hs-identifier hs-var">h</span></a></span></span><span> </span><span id="local-6989586621679563963"><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621679563963"><span class="hs-identifier hs-var">sz</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; (Ptr CWchar -&gt; IO FilePath) -&gt; IO FilePath
forall a b. Storable a =&gt; Int -&gt; (Ptr a -&gt; IO b) -&gt; IO b
</span><a href="Foreign.Marshal.Array.html#allocaArray"><span class="hs-identifier hs-var">allocaArray</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word32 -&gt; Int
forall a b. (Integral a, Num b) =&gt; a -&gt; b
</span><a href="GHC.Real.html#fromIntegral"><span class="hs-identifier hs-var">fromIntegral</span></a></span><span> </span><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621679563963"><span class="hs-identifier hs-var">sz</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">((Ptr CWchar -&gt; IO FilePath) -&gt; IO FilePath)
-&gt; (Ptr CWchar -&gt; IO FilePath) -&gt; IO FilePath
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621679563962"><span class="annot"><span class="annottext">Ptr CWchar
</span><a href="#local-6989586621679563962"><span class="hs-identifier hs-var">outPath</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-225"></span><span>          </span><span id="local-6989586621679563961"><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621679563961"><span class="hs-identifier hs-var">ret</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Ptr () -&gt; Ptr CWchar -&gt; Word32 -&gt; Word32 -&gt; IO Word32
</span><a href="System.Environment.ExecutablePath.html#c_getFinalPathHandle"><span class="hs-identifier hs-var">c_getFinalPathHandle</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr ()
</span><a href="#local-6989586621679563964"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr CWchar
</span><a href="#local-6989586621679563962"><span class="hs-identifier hs-var">outPath</span></a></span><span> </span><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621679563963"><span class="hs-identifier hs-var">sz</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word32
</span><span class="hs-number">8</span></span><span class="hs-special">)</span><span>
</span><span id="line-226"></span><span class="hs-pragma">{-# LINE 226 &quot;libraries\\base\\System\\Environment\\ExecutablePath.hsc&quot; #-}</span><span>
</span><span id="line-226"></span><span>          </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621679563961"><span class="hs-identifier hs-var">ret</span></a></span><span> </span><span class="annot"><span class="annottext">Word32 -&gt; Word32 -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><a href="../../ghc-prim/src/GHC.Classes.html#%3C"><span class="hs-operator hs-var">&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621679563963"><span class="hs-identifier hs-var">sz</span></a></span><span>
</span><span id="line-227"></span><span>            </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath
</span><a href="#local-6989586621679563959"><span class="hs-identifier hs-var">sanitize</span></a></span><span> </span><span class="annot"><span class="annottext">(FilePath -&gt; FilePath)
-&gt; (FilePath -&gt; FilePath) -&gt; FilePath -&gt; FilePath
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath
</span><a href="#local-6989586621679563957"><span class="hs-identifier hs-var">rejectUNCPath</span></a></span><span> </span><span class="annot"><span class="annottext">(FilePath -&gt; FilePath) -&gt; IO FilePath -&gt; IO FilePath
forall (f :: * -&gt; *) a b. Functor f =&gt; (a -&gt; b) -&gt; f a -&gt; f b
</span><a href="Data.Functor.html#%3C%24%3E"><span class="hs-operator hs-var">&lt;$&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr CWchar -&gt; IO FilePath
</span><a href="Foreign.C.String.html#peekCWString"><span class="hs-identifier hs-var">peekCWString</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr CWchar
</span><a href="#local-6989586621679563962"><span class="hs-identifier hs-var">outPath</span></a></span><span>
</span><span id="line-228"></span><span>            </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">Ptr () -&gt; Word32 -&gt; IO FilePath
</span><a href="#local-6989586621679563976"><span class="hs-identifier hs-var">go</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr ()
</span><a href="#local-6989586621679563964"><span class="hs-identifier hs-var">h</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word32
</span><span class="hs-number">2</span></span><span> </span><span class="annot"><span class="annottext">Word32 -&gt; Word32 -&gt; Word32
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="GHC.Num.html#%2A"><span class="hs-operator hs-var">*</span></a></span><span> </span><span class="annot"><span class="annottext">Word32
</span><a href="#local-6989586621679563963"><span class="hs-identifier hs-var">sz</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-229"></span><span>
</span><span id="line-230"></span><span>        </span><span id="local-6989586621679563959"><span class="annot"><span class="annottext">sanitize :: FilePath -&gt; FilePath
</span><a href="#local-6989586621679563959"><span class="hs-identifier hs-var hs-var">sanitize</span></a></span></span><span> </span><span id="local-6989586621679563953"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679563953"><span class="hs-identifier hs-var">s</span></a></span></span><span>
</span><span id="line-231"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;\\\\?\\&quot;</span></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; Bool
forall a. Eq a =&gt; [a] -&gt; [a] -&gt; Bool
</span><a href="Data.OldList.html#isPrefixOf"><span class="hs-operator hs-var">`isPrefixOf`</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679563953"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; FilePath -&gt; FilePath
forall a. Int -&gt; [a] -&gt; [a]
</span><a href="GHC.List.html#drop"><span class="hs-identifier hs-var">drop</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">4</span></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679563953"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-232"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679563953"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-233"></span><span>
</span><span id="line-234"></span><span>        </span><span class="hs-comment">-- see https://gitlab.haskell.org/ghc/ghc/issues/14460</span><span>
</span><span id="line-235"></span><span>        </span><span id="local-6989586621679563957"><span class="annot"><span class="annottext">rejectUNCPath :: FilePath -&gt; FilePath
</span><a href="#local-6989586621679563957"><span class="hs-identifier hs-var hs-var">rejectUNCPath</span></a></span></span><span> </span><span id="local-6989586621679563950"><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679563950"><span class="hs-identifier hs-var">s</span></a></span></span><span>
</span><span id="line-236"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><span class="hs-string">&quot;\\\\?\\UNC\\&quot;</span></span><span> </span><span class="annot"><span class="annottext">FilePath -&gt; FilePath -&gt; Bool
forall a. Eq a =&gt; [a] -&gt; [a] -&gt; Bool
</span><a href="Data.OldList.html#isPrefixOf"><span class="hs-operator hs-var">`isPrefixOf`</span></a></span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679563950"><span class="hs-identifier hs-var">s</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679563989"><span class="hs-identifier hs-var">path</span></a></span><span>
</span><span id="line-237"></span><span>          </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FilePath
</span><a href="#local-6989586621679563950"><span class="hs-identifier hs-var">s</span></a></span><span>
</span><span id="line-238"></span><span>
</span><span id="line-239"></span><span>        </span><span class="hs-comment">-- the initial size of the buffer in which we store the</span><span>
</span><span id="line-240"></span><span>        </span><span class="hs-comment">-- final path; if this is not enough, we try with a buffer of</span><span>
</span><span id="line-241"></span><span>        </span><span class="hs-comment">-- size 2^k * bufSize, for k = 1, 2, 3, ... until the buffer</span><span>
</span><span id="line-242"></span><span>        </span><span class="hs-comment">-- is large enough.</span><span>
</span><span id="line-243"></span><span>        </span><span id="local-6989586621679563975"><span class="annot"><span class="annottext">bufSize :: Word32
</span><a href="#local-6989586621679563975"><span class="hs-identifier hs-var hs-var">bufSize</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Word32
</span><span class="hs-number">1024</span></span><span>
</span><span id="line-244"></span><span>
</span><span id="line-245"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-keyword">unsafe</span><span> </span><span class="hs-string">&quot;windows.h GetModuleFileNameW&quot;</span><span>
</span><span id="line-246"></span><span>    </span><span id="c_GetModuleFileName"><span class="annot"><a href="System.Environment.ExecutablePath.html#c_GetModuleFileName"><span class="hs-identifier hs-var">c_GetModuleFileName</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Foreign.C.String.html#CWString"><span class="hs-identifier hs-type">CWString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span>
</span><span id="line-247"></span><span>
</span><span id="line-248"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-keyword">unsafe</span><span> </span><span class="hs-string">&quot;windows.h PathFileExistsW&quot;</span><span>
</span><span id="line-249"></span><span>    </span><span id="c_pathFileExists"><span class="annot"><a href="System.Environment.ExecutablePath.html#c_pathFileExists"><span class="hs-identifier hs-var">c_pathFileExists</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Foreign.C.String.html#CWString"><span class="hs-identifier hs-type">CWString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span>
</span><span id="line-250"></span><span>
</span><span id="line-251"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-keyword">unsafe</span><span> </span><span class="hs-string">&quot;windows.h CreateFileW&quot;</span><span>
</span><span id="line-252"></span><span>    </span><span id="c_createFile"><span class="annot"><a href="System.Environment.ExecutablePath.html#c_createFile"><span class="hs-identifier hs-var">c_createFile</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Foreign.C.String.html#CWString"><span class="hs-identifier hs-type">CWString</span></a></span><span>
</span><span id="line-253"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span>
</span><span id="line-254"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span>
</span><span id="line-255"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-256"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span>
</span><span id="line-257"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span>
</span><span id="line-258"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-259"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-260"></span><span>
</span><span id="line-261"></span><span class="annot"><a href="System.Environment.ExecutablePath.html#createFile"><span class="hs-identifier hs-type">createFile</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="Foreign.C.String.html#CWString"><span class="hs-identifier hs-type">CWString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-262"></span><span id="createFile"><span class="annot"><span class="annottext">createFile :: Ptr CWchar -&gt; IO (Ptr ())
</span><a href="System.Environment.ExecutablePath.html#createFile"><span class="hs-identifier hs-var hs-var">createFile</span></a></span></span><span> </span><span id="local-6989586621679563946"><span class="annot"><span class="annottext">Ptr CWchar
</span><a href="#local-6989586621679563946"><span class="hs-identifier hs-var">file</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-263"></span><span>  </span><span class="annot"><span class="annottext">Ptr CWchar
-&gt; Word32
-&gt; Word32
-&gt; Ptr ()
-&gt; Word32
-&gt; Word32
-&gt; Ptr ()
-&gt; IO (Ptr ())
</span><a href="System.Environment.ExecutablePath.html#c_createFile"><span class="hs-identifier hs-var">c_createFile</span></a></span><span> </span><span class="annot"><span class="annottext">Ptr CWchar
</span><a href="#local-6989586621679563946"><span class="hs-identifier hs-var">file</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word32
</span><span class="hs-number">2147483648</span></span><span class="hs-special">)</span><span>
</span><span id="line-264"></span><span class="hs-pragma">{-# LINE 264 &quot;libraries\\base\\System\\Environment\\ExecutablePath.hsc&quot; #-}</span><span>
</span><span id="line-264"></span><span>                    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word32
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span>
</span><span id="line-265"></span><span class="hs-pragma">{-# LINE 265 &quot;libraries\\base\\System\\Environment\\ExecutablePath.hsc&quot; #-}</span><span>
</span><span id="line-265"></span><span>                    </span><span class="annot"><span class="annottext">Ptr ()
forall a. Ptr a
</span><a href="GHC.Ptr.html#nullPtr"><span class="hs-identifier hs-var">nullPtr</span></a></span><span>
</span><span id="line-266"></span><span>                    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word32
</span><span class="hs-number">3</span></span><span class="hs-special">)</span><span>
</span><span id="line-267"></span><span class="hs-pragma">{-# LINE 267 &quot;libraries\\base\\System\\Environment\\ExecutablePath.hsc&quot; #-}</span><span>
</span><span id="line-267"></span><span>                    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Word32
</span><span class="hs-number">128</span></span><span class="hs-special">)</span><span>
</span><span id="line-268"></span><span class="hs-pragma">{-# LINE 268 &quot;libraries\\base\\System\\Environment\\ExecutablePath.hsc&quot; #-}</span><span>
</span><span id="line-268"></span><span>                    </span><span class="annot"><span class="annottext">Ptr ()
forall a. Ptr a
</span><a href="GHC.Ptr.html#nullPtr"><span class="hs-identifier hs-var">nullPtr</span></a></span><span>
</span><span id="line-269"></span><span>
</span><span id="line-270"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-keyword">unsafe</span><span> </span><span class="hs-string">&quot;windows.h CloseHandle&quot;</span><span>
</span><span id="line-271"></span><span>  </span><span id="c_closeHandle"><span class="annot"><a href="System.Environment.ExecutablePath.html#c_closeHandle"><span class="hs-identifier hs-var">c_closeHandle</span></a></span></span><span>  </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#Bool"><span class="hs-identifier hs-type">Bool</span></a></span><span>
</span><span id="line-272"></span><span>
</span><span id="line-273"></span><span class="hs-keyword">foreign</span><span> </span><span class="hs-keyword">import</span><span> </span><span class="hs-identifier">WINDOWS_CCONV</span><span> </span><span class="hs-keyword">unsafe</span><span> </span><span class="hs-string">&quot;windows.h GetFinalPathNameByHandleW&quot;</span><span>
</span><span id="line-274"></span><span>  </span><span id="c_getFinalPathHandle"><span class="annot"><a href="System.Environment.ExecutablePath.html#c_getFinalPathHandle"><span class="hs-identifier hs-var">c_getFinalPathHandle</span></a></span></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Ptr.html#Ptr"><span class="hs-identifier hs-type">Ptr</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="Foreign.C.String.html#CWString"><span class="hs-identifier hs-type">CWString</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../ghc-prim/src/GHC.Types.html#IO"><span class="hs-identifier hs-type">IO</span></a></span><span> </span><span class="annot"><a href="GHC.Word.html#Word32"><span class="hs-identifier hs-type">Word32</span></a></span><span>
</span><span id="line-275"></span><span>
</span><span id="line-276"></span><span class="hs-comment">--------------------------------------------------------------------------------</span><span>
</span><span id="line-277"></span><span class="hs-comment">-- Fallback to argv[0]</span><span>
</span><span id="line-278"></span><span>
</span><span id="line-279"></span><span>
</span><span id="line-280"></span><span class="hs-pragma">{-# LINE 300 &quot;libraries\\base\\System\\Environment\\ExecutablePath.hsc&quot; #-}</span><span>
</span><span id="line-300"></span></pre></body></html>